package cn.wolfcode.util;

import lombok.Getter;

@Getter
public enum RedisKeys {
    //登录token的key实例对象
    USER_LOGIN("user_login",Consts.USER_INFO_TOKEN_VAI_TIME * 60L),
    //顶(点赞)的key实例对象
    STRATEGY_THUMBSUP("strategy_thumbsup",-1L),
    //收藏数的key实例对象
    STRATEGY_FAVOR("strategy_favor",-1L),
    //阅读数的key实例对象
     STRATEGY_STATIS_VO("VERIFY_CODE",-1L),
    //登录token的key实例对象
    VERIFY_CODE("verify_code",Consts.VERIFY_CODE_VAI_TIME * 60L);

     private String prefix;
     private Long time;

    RedisKeys(String prefix, Long time) {
        this.prefix = prefix;
        this.time = time;
    }

    public String join(String... values){
        StringBuilder sb = new StringBuilder(80);
        for (String value : values){
            sb.append(this.prefix).append(":").append(value);
        }
        return sb.toString();
    }

}